package com.huey.utils.execl.check;


import com.huey.utils.execl.IDCardUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;

/**
 * 身份证校验
 * @author xubo
 */
public class IdCardCheck implements CheckRule{
    @Override
    public String check(Object value, Cell cell, Integer columnIndex, Integer startRowNumber) {
        String result = "身份证格式错误";
        if(value == null){
            return null;
        }
        if(StringUtils.isBlank(value.toString())){
            return null;
        }
        if(!IDCardUtils.validate(value.toString())){
            return result;
        }
        return null;
    }
}
